package com.ttc.mBackup.BackupAgent;

import android.content.Context;
import android.graphics.Color;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.TextView;

import com.ttc.mBackup.R;

public class TextViewBase extends BaseAdapter{

	private Context mContext;

    public TextViewBase(Context c) {
        mContext = c;
    }

    public int getCount() {
        return adapter.length;
    }

    public Object getItem(int position) {
        return null;
    }

    public long getItemId(int position) {
        return 0;
    }

    // create a new ImageView for each item referenced by the Adapter
    public View getView(int position, View convertView, ViewGroup parent) {
        TextView textView;
        if (convertView == null) {  // if it's not recycled, initialize some attributes
        	textView = new TextView(mContext);
        	textView.setLayoutParams(new GridView.LayoutParams(37, 37));
        	
        	textView.setPadding(8, 8, 8, 8);
        } else {
        	
        	textView = (TextView) convertView;
        }
        if(position==0){
        textView.setBackgroundColor(Color.rgb(204, 204, 204));
        }
        else
        {
        	textView.setBackgroundColor(Color.rgb(51, 51, 51));
        }
        textView.setGravity(Gravity.CENTER);
        textView.setText(String.valueOf(adapter[position]));
        return textView;
    }

    // references to our Days Of Month
   
    private Integer[] adapter={1,2,3,4,5,6
    						,7,8,9,10,11,12,13
    						,14,15,16,17,18,19
    						,20,21,22,23,24,25
    						,26,27,28,29,30,31};
}

